Next | Prev | Up | Top | Contents | Index

Entry Point close()

The kernel calls the pfxclose() entry when the last process calls close() or umount() for the device special file. It is important to know that when the device can be opened by multiple processes, pfxclose() is not called for every close() function, but only when the last remaining process closes the device and no other processes have it open.

The function prototype and arguments of pfxclose() are

int pfxclose(dev_t dev, int flag, int otyp, cred_t *crp);

The arguments are the same as were passed to pfxopen(). However, the flag argument is not necessarily the same as at any particular call to open().

It is up to you to design the meaning of "close" for this type of device:

The pfxclose() entry can detect an error and report it with a return code. However, the file is closed or unmounted regardless.


Next | Prev | Up | Top | Contents | Index